<h1>RailsTimeClock</h1>

<table>
  <tr>
    <th><%= t(:user) %></th>
    <th><%= t(:status) %></th>
    <th><%= t(:time) %></th>
  </tr>
  
  <% User.all.each do |u| %>
    <tr class="<%= u.punches.first(:order => 'created_at DESC').in_or_out if u.ever_worked? %>">
    <td><%= u.get_name %></td>
    <td><%= u.ever_worked? ? u.punches.first(:order => 'created_at DESC').in_or_out : t(:never_worked) %></td>
    <td><%= u.ever_worked? ? u.punches.first(:order => 'created_at DESC').created_at.strftime("%d/%m/%Y %H:%M") : t(:never_worked) %></td>
  </tr>
  <% end %>
</table>

<script type="text/javascript">
  window.setTimeout("window.location.reload()", 60000);
</script>
